from application import db


class User(db.Model):
    __tablename__ = 'user'

    uid = db.Column(db.BigInteger, primary_key=True, info='鐢ㄦ埛uid')
    nickname = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue(), info='鐢ㄦ埛鍚')
    mobile = db.Column(db.String(20), nullable=False, server_default=db.FetchedValue(), info='鎵嬫満鍙风爜')
    email = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue(), info='閭??鍦板潃')
    sex = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='1锛氱敺 2锛氬コ 0锛氭病濉?啓')
    avatar = db.Column(db.String(64), nullable=False, server_default=db.FetchedValue(), info='澶村儚')
    login_name = db.Column(db.String(20), nullable=False, unique=True, server_default=db.FetchedValue(),
                           info='鐧诲綍鐢ㄦ埛鍚')
    login_pwd = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(), info='鐧诲綍瀵嗙爜')
    login_salt = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(),
                           info='鐧诲綍瀵嗙爜鐨勯殢鏈哄姞瀵嗙?閽')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='1锛氭湁鏁?0锛氭棤鏁')
    updated_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(),
                             info='鏈?悗涓??鏇存柊鏃堕棿')
    created_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='鎻掑叆鏃堕棿')
